package com.woparker.kiosk.bean;


public class NodeBean {
    public int x;// X坐标
    public int y;// Y坐标
    public NodeBean parentNode;// 父类节点
    public int g;// 当前点到起点的移动耗费
    public int h;// 当前点到终点的移动耗费，即曼哈顿距离|x1-x2|+|y1-y2|(忽略障碍物)
    public int f;// f=g+h

    public NodeBean(int x, int y, NodeBean parentNode) {
        this.x = x;
        this.y = y;
        this.parentNode = parentNode;
    }

    public int compareTo(NodeBean candidate) {
        return this.f - candidate.f;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public NodeBean getParentNode() {
        return parentNode;
    }

    public void setParentNode(NodeBean parentNode) {
        this.parentNode = parentNode;
    }

    public int getG() {
        return g;
    }

    public void setG(int g) {
        this.g = g;
    }

    public int getH() {
        return h;
    }

    public void setH(int h) {
        this.h = h;
    }

    public int getF() {
        return f;
    }

    public void setF(int f) {
        this.f = f;
    }

    public String toString() {
        return "(" + x + "," + y + "," + f + ")";
    }
}
